package com.baogu.database.service.impl;

import com.baogu.database.mapper.SensorDataImportMapper;
import com.baogu.database.mapper.SensorWarningImportMapper;
import com.baogu.database.service.SensorDataImportService;
import com.baogu.model.database.SensorDataImport;
import com.baogu.model.database.where.SensorDataImportWhere;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SensorDataImportaImportServiceImpl implements SensorDataImportService {

    @Autowired
    private SensorDataImportMapper sensorDataImportMapper;

    @Override
    public List<SensorDataImport> allList(SensorDataImportWhere where) {
        return sensorDataImportMapper.allList(where);
    }

    @Override
    public SensorDataImport getImpprtByVersion(String version) {
        SensorDataImportWhere where = new SensorDataImportWhere();
        where.setVersion(version);
        List<SensorDataImport> list = sensorDataImportMapper.allList(where);
        return list.get(0);
    }

    @Override
    public Integer updataDataImport(SensorDataImport sensorDataImport) {
        return sensorDataImportMapper.updateByPrimaryKeySelective(sensorDataImport);
    }
}
